package me.service.impl;

import java.util.concurrent.TimeUnit;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import me.service.CacheService;
@Service
public class CacheServiceImpl implements CacheService {
	@Autowired
	private RedisTemplate<String, String> RedisTemplate;
	@Override
	public void set(String key,String value,Long liveTime) {
		RedisTemplate.opsForValue().set(key, value,liveTime,TimeUnit.SECONDS);
	}
	@Override
	public Object get(String key) {
		return RedisTemplate.opsForValue().get(key);
	}

}
